home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / internal / m68k / m68k-emul / switch.s < prev   
Encoding:
Text File  |  1996-07-16  |  679 b   |  35 lines

  1.     Dispatch    =    -0x2a
  2.     Enqueue     =    -0x10e
  3.     ThisTask    =    0x114
  4.     AttnResched =    0x12a
  5.     TaskReady   =    0x196
  6.     tc_Flags    =    0xe
  7.     tc_State    =    0xf
  8.     TS_RUN        =    2
  9.     TS_READY    =    3
  10.     TB_EXCEPT   =    5
  11.  
  12.     .globl    _Exec_Switch
  13. _Exec_Switch:
  14.     | Preserve scratch registers
  15.     moveml    d0/d1/a0/a1,sp@-
  16.  
  17.     | If not in state TS_RUN the current task is already moved
  18.     | to one of the task lists.
  19.     movel    a6@(ThisTask),a1
  20.     cmpb    #TS_RUN,a1@(tc_State)
  21.     jne    disp
  22.  
  23.     | If TB_EXCEPT is not set...
  24.     btst    #TB_EXCEPT,a1@(tc_Flags)
  25.     jne    disp
  26.  
  27.     | ...move task to the ready list
  28.     moveb    #TS_READY,a1@(tc_State)
  29.     leal    a6@(TaskReady),a0
  30.     jsr    a6@(Enqueue)
  31.  
  32.     | dispatch
  33. disp:    moveml    sp@+,d0/d1/a0/a1
  34.     jmp    a6@(Dispatch)
  35.